#include "widget.h"
#include "ui_widget.h"
#include "QPushButton"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    //创建按钮,传入this指针将其挂在对象树上
    QPushButton * Button = new QPushButton(this);
    Button->setText("Hello World");
}

Widget::~Widget()
{
    delete ui;
}
